using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Slaks.TextParsing
{
	/// <summary>
	/// Summary description for Progress.
	/// </summary>
	public class Progress : System.Windows.Forms.Form
	{
    private System.Windows.Forms.ProgressBar m_progressPB;
    private System.Windows.Forms.Button m_cancelBtn;
		private System.ComponentModel.Container components = null;

		public Progress()
		{
			InitializeComponent();
		}

    public int MaximumValue
    {
      get { return m_progressPB.Maximum; }
      set { m_progressPB.Maximum = value; }
    }

    public int CurrentValue
    {
      get { return m_progressPB.Value; }
      set 
      {
        m_progressPB.Value = value;
        if (CurrentValue == MaximumValue) 
        {
          this.Hide();
          CurrentValue = 0;
        }
      }
    }

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      this.m_progressPB = new System.Windows.Forms.ProgressBar();
      this.m_cancelBtn = new System.Windows.Forms.Button();
      this.SuspendLayout();
      // 
      // m_progressPB
      // 
      this.m_progressPB.Location = new System.Drawing.Point(0, 0);
      this.m_progressPB.Name = "m_progressPB";
      this.m_progressPB.Size = new System.Drawing.Size(288, 16);
      this.m_progressPB.Step = 1;
      this.m_progressPB.TabIndex = 0;
      this.m_progressPB.Value = 55;
      // 
      // m_cancelBtn
      // 
      this.m_cancelBtn.Location = new System.Drawing.Point(112, 32);
      this.m_cancelBtn.Name = "m_cancelBtn";
      this.m_cancelBtn.TabIndex = 1;
      this.m_cancelBtn.Text = "Cancel";
      // 
      // Progress
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(292, 62);
      this.ControlBox = false;
      this.Controls.Add(this.m_cancelBtn);
      this.Controls.Add(this.m_progressPB);
      this.Name = "Progress";
      this.Text = "Parsing in progress";
      this.ResumeLayout(false);

    }
		#endregion
	}
}
